package gui;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JPanel;

@SuppressWarnings("serial")
public class ScenarioPanel extends JPanel 
{
	ScenarioView view;

	public ScenarioPanel(ScenarioView view){
		this.view = view;
	}

	public void paintComponent(Graphics g) {
		super.paintComponent(g);    

		g.setColor(Color.WHITE);
		Dimension size = getSize();
		g.fillRect(0, 0, size.width, size.height);

		for (ParteCenario part: view.getParts()){
			part.draw(size,(Graphics2D)g);
		}
	}       
}
